package cn.jbit.smbms.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.jbit.smbms.dao.UserDao;
import cn.jbit.smbms.pojo.User;
import cn.jbit.smbms.service.UserService;
@Service("userService")
public class UserServiceImpl implements UserService {
	@Resource
	private UserDao userDao;


	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}


	@Override
	public User get(Integer id) {
		return null;
	}

	@Override
	public List<User> list() {
		return null;
	}

	@Override
	public List<User> list(User user) {
		return null;
	}

	@Override
	public User login(String userCode, String userPassword) {
		return userDao.login(userCode,userPassword);
	}

	@Override
	public boolean add(User user) {
		return userDao.insert(user)>0;
	}

	@Override
	public boolean remove(Integer id) {
		return userDao.delete(id)>0;
	}


	@Override
	public int update(User user) {
		return userDao.update(user);
	}

	@Override
	public int queryCountByParam(Map<String, Object> param) {
		return userDao.queryCountByParam(param);
	}

	@Override
	public List<User> queryListByParam(Map<String, Object> param) {
		return userDao.queryListByParam(param);
	}

	@Override
	public int insert(User user) {
		return userDao.insert(user);
	}

	@Override
	public int deleteById(Integer id) {
		return userDao.delete(id);
	}

	@Override
	public User queryById(Integer id) {
		return userDao.selectById(id);
	}


}
